<template>
	<view>
		<rich-text :nodes="content"></rich-text>
	</view>
</template>

<script>
	import {
		getByType
	} from '../../common/api.js'
	export default {
		data() {
			return {
				titleList: {
					1: '用户协议',
					2: '隐私协议',
					3: '积分规则'
				},
				content: ''
			}
		},
		onLoad(option) {
			this.type = option.type
			uni.setNavigationBarTitle({
				title: this.titleList[this.type]
			})
			this.getByType()
		},
		methods: {
			getByType() {
				getByType(this.type).then(res => {
					console.log(res)
					this.content = res.result.content
				})
			}
		}
	}
</script>

<style>

</style>